package com.becca.cake.dao.statistics;

import java.util.List;
import java.util.Map;

import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Repository;

import com.becca.cake.core.exception.ServiceException;
import com.becca.cake.model.order.OrderDetailsModel;
import com.becca.cake.model.order.OrderModel;
import com.becca.cake.model.statistics.FollowSourceModel;
import com.becca.cake.model.statistics.FusionChartsModel;
import com.becca.cake.model.statistics.OrderReportDateTimeModel;
import com.becca.cake.model.statistics.OrderReportGoodsModel;
import com.becca.cake.model.statistics.OrderReportModel;
import com.becca.cake.model.statistics.OrderRoseModel;
import com.becca.cake.model.statistics.OrderTypeCountModel;
import com.becca.cake.model.statistics.SaleReportModel;
import com.becca.cake.model.statistics.UserConsumptionModel;

/**
 * 统计管理DAO接口
 * @author yellow
 * 
 */
@Repository
public interface StatisticDAO {
    /**
     * 统计订单商品数量
     * @param map
     * @return
     * @throws ServiceException
     */
    List<OrderModel> selectSatasticOrderGoods(Map<String, Object> map) throws DataAccessException;

    /**
     * 订单统计导出Excel
     * @param map
     * @return
     * @throws DataAccessException
     */
    List<OrderDetailsModel> getExportStatisticsOrder(Map<String, Object> map)
                                                                             throws DataAccessException;

    /**
     * 统计订单优惠码使用情况
     * @param map
     * @return
     * @throws DataAccessException
     */
    List<OrderModel> selectSatasticCouponCode(Map<String, Object> map) throws DataAccessException;

    /**
     * 订单类型统计图表
     * @param map
     * @return
     */
    List<OrderTypeCountModel> selectCountOrderByOrderType(Map<String, Object> map);

    /**
     * 订单总金额统计
     * @return
     */
    List<OrderModel> selectCountOrderAmountByOrderType(Map<String, Object> paramMap);

    /**
     * SKU统计
     * @param paramMap
     * @return
     */
    List<OrderTypeCountModel> selectCountOrderBySku(Map<String, Object> paramMap);

    /**
     * 查询订单统计报表数据
     * @param paramMap
     * @return
     */
    OrderModel selectOrderReportInfo(Map<String, Object> paramMap);

    /**
     * 查询订单统计信息
     * @param paramMap
     * @return
     */
    List<OrderRoseModel> selectOrderRoseChart(Map<String, Object> paramMap);

    /**
     * b2c订单状态查询统计报表查询
     * @param paramMap
     * @return
     */
    OrderReportModel selectB2cOrderReportByStatus(Map<String, Object> paramMap);

    /**
     * b2b订单状态查询统计报表查询
     * @param paramMap
     * @return
     */
    OrderReportModel selectB2bOrderReportByStatus(Map<String, Object> paramMap);

    /**
     * 订单时间段统计
     * @param paramMap
     * @return
     */
    List<OrderReportDateTimeModel> selectOrderReportTimeTotal(Map<String, Object> paramMap);

    /**
     * 销售订单详情统计
     * @param paramMap
     * @return
     */
    List<OrderReportGoodsModel> selectOrderReportGoodsTotal(Map<String, Object> paramMap);

    /**
     * 订单销售金额月报统计
     * @param paramMap
     * @return
     */
    List<FusionChartsModel> selectOrderAmountByMonth(Map<String, Object> paramMap);

    /**
     * 订单销售报表统计
     * @param map
     * @return
     */
    List<SaleReportModel> selectOrderSaleReport(Map<String, Object> map);

    /**
     * 抵用券销售额统计
     * @param map
     * @return
     */
    List<SaleReportModel> selectVoucherOrderSaleReport(Map<String, Object> map);

    /**
     * 统计当天sku销售数量情况统计情况
     * @param paramMap
     * @return
     */
    List<FusionChartsModel> selectOrderGoodsNumAmountByMonth(Map<String, Object> paramMap);

    /**
     * 用户消费统计
     * @param map
     * @return
     */
    List<UserConsumptionModel> selectUserConsumption(Map<String, Object> map)
                                                                             throws DataAccessException;

    /**
     * 用户消费统计总数
     * @param map
     * @return
     */
    long selectUserConsumptionCount(Map<String, Object> map) throws DataAccessException;

    /**
     * 用户消费详情统计
     * @param map
     * @return
     */
    List<UserConsumptionModel> selectUserConsumptionDetail(Map<String, Object> map)
                                                                                   throws DataAccessException;

    /**
     * 用户消费详情统计总数
     * @param map
     * @return
     */
    long selectUserConsumptionDetailCount(Map<String, Object> map) throws DataAccessException;

    /**
     * 订单报表查询已退款订单信息
     * @param map
     * @return
     */
    OrderReportModel selectB2cOrderRefunds(Map<String, Object> map);

    /**
     * 订单报表查询把b2b补差价订单
     * @param map
     * @return
     */
    OrderReportModel selectB2bOrderDifference(Map<String, Object> map);

    /**
     * 订单报表B2B已退款订单信息
     * @param map
     * @return
     */
    OrderReportModel selectB2bOrderRefunds(Map<String, Object> map);
    
    /**
     * 查询渠道关注统计信息
     * @param paramMap
     * @return
     */
    List<FollowSourceModel> selectFollowSourceChart(Map<String, Object> paramMap);

}
